package com.wing.purchase.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.purchase.model.entity.PurchaseQuotationDetail;
import com.wing.purchase.model.request.PurchaseQuotationDetailForm;
import com.wing.purchase.model.response.PurchaseQuotationDetailVO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 报价单明细-Service
 *
 * @author
 */
public interface PurchaseQuotationDetailService extends IService<PurchaseQuotationDetail> {

    /**
     * 添加
     *
     * @param purchaseQuotationDetailForm
     * @return
     */
    int add(PurchaseQuotationDetailForm purchaseQuotationDetailForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<PurchaseQuotationDetailVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<PurchaseQuotationDetailVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    PurchaseQuotationDetailVO get4appById(Long id);

    /**
     * 分配采购量
     * @param id
     * @param allocationPurchases
     * @return
     */
    int allocationPurchases(Long id, BigDecimal allocationPurchases);

    /**
     * 生单成功后修改报价单明细为已生单
     * @param quotationDetailIds
     * @return
     */
    int updIsGenerateOrder(List<Long> quotationDetailIds);
}
